﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace CropPic
{
    class FileDir
    {
        private string rootFold;
        private string cropPicFolder;
        private string annotationFolder;
        
        //视频图片输出目录
        private string videoDir;
        
        //裁剪文件文件名
        private string fileOutputName = "";
        //注释文件文件名
        private string fileAnnoName = "";
        //视频帧整幅图片文件名
        private string imageOutputName = "";

        public string RootFold
        {
            set { rootFold = value; }
            get { return rootFold; }
        }

        public string CropPicFolder
        {
            set { cropPicFolder = value; }
            get { return cropPicFolder; }
        }

        public string AnnotationFolder
        {
            set { annotationFolder = value; }
            get { return annotationFolder; }
        }

        public string VideoDir
        {
            set { videoDir = value; }
            get { return videoDir; }
        }

        public string FileOutputName
        {
            set { fileOutputName = value; }
            get { return fileOutputName; }
        }

        public string FileAnnoName
        {
            set { fileAnnoName = value; }
            get { return fileAnnoName; }
        }

        public string ImageOutputName
        {
            set { imageOutputName = value; }
            get { return imageOutputName; }
        }
        /**
         * 构造函数
         * */
        public FileDir(string _rootFold)
        {
            rootFold = _rootFold;
            cropPicFolder = _rootFold + "\\croped\\";
            AnnotationFolder = _rootFold + "\\annotations\\";
        }


        /**
         * 创建文件夹
         * */
        public void mkFold()
        {
            if (!Directory.Exists(cropPicFolder))
            {
                //文件夹不存在,创建一个
                Directory.CreateDirectory(cropPicFolder);
            }
            if (!Directory.Exists(AnnotationFolder))
            {
                //文件夹不存在,创建一个
                Directory.CreateDirectory(AnnotationFolder);
            }
        }

        
        /// <summary>
        /// 创建帧保存的目录
        /// </summary>
        public void mkVidDir()
        {
            if (!Directory.Exists(videoDir))
            {
                //文件夹不存在,创建一个
                Directory.CreateDirectory(videoDir);
            }
            mkFold();
        }

    }
    /*----------- end of class FileDir ----------*/
}
